package com.zlq.cn.controller;


import com.zlq.cn.api.SignApiResult;
import com.zlq.cn.entity.ZhChArticle;
import com.zlq.cn.service.un.ZhChArticleService;
import com.zlq.cn.util.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 中英文章 前端控制器
 * </p>
 *
 * @author zhoucl
 * @since 2024-06-02
 */
@Api(tags = "公共-中英文章")
@RestController
@RequestMapping("/api/common/zh/Ch/article")
public class ZhChArticleController {

    @Resource
    private ZhChArticleService zhChArticleService;

    @ApiOperation("所有数据")
    @GetMapping("/list")
    public SignApiResult<List<ZhChArticle>> list(ZhChArticle param) {
        return SignApiResult.resultSuccess(zhChArticleService.lambdaQuery()
                .like(StringUtils.isNotBlank(param.getZhTitle()), ZhChArticle::getZhTitle, param.getZhTitle())
                .list());
    }
}

